import { Component } from "react";

// import FuncChild from './FuncChild'
import ClassChild from './ClassChild'

export default class Parent extends Component{

  constructor(){
    super()
    this.state={
      foods:{
        name:'大份薯条',
        price:19
      }
    }
  }
  change=value=>{
    this.setState({
      price:this.state.foods.price += value

    })
  }
  render(){
    return (<div>
      Parent
      <hr />
      {/* <FuncChild name='李四' age={18} hobby={['追剧','动漫','跳舞']} address={{province:'四川',city:'重庆'}}/> */}
      {/* 只有字符串不用加 { } */}
   
      <ClassChild admin='张三'  age={'age:'+20} foods={this.state.foods} callback={this.change}/>
    </div>)
  }
}